﻿<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<html>
<head>
    <title>报文查询界面</title>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap.min.css"/>'/>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap-theme.min.css"/>'/>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/resources/css/content.css"/>'/>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/resources/js/common/bootstrap-datetimepicker.min.css"/>'/>
    <script src='<spring:url value="/webjars/jquery/1.11.1/jquery.min.js"/>'></script>
    <script src='<spring:url value="/webjars/bootstrap/3.3.5/js/bootstrap.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular.min.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular-resource.js"/>'></script>
    <script src='<spring:url value="/webjars/bootbox/4.4.0/bootbox.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/bootstrap-datetimepicker.min.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/pageUtil.js"/>'></script>
    <script src='<spring:url value="/resources/js/traffic/TrafficModel.js"/>'></script>
    <script src='<spring:url value="/resources/js/traffic/TrafficService.js"/>'></script>
    <script src='<spring:url value="/resources/js/traffic/TrafficController.js"/>'></script>
</head>
<body ng-app="app" ng-controller="trafficCtrl">
<div class="adcc-container">
    <ol class="breadcrumb">
        <li class="active">系统管理</li>
        <li class="active">报文查询</li>
    </ol>
    <form role="form" method="post">
        <div class="form-group">
            <label class="col-sm-1 control-label">报文类型</label>

            <div class="col-md-2">
                <select class="form-control" ng-model="searchType" ng-init="searchType=''">
                    <option value="">--</option>
                    <option value='Downlink'>Downlink</option>
                    <option value='Uplink'>Uplink</option>
                    <option value='Ground'>Ground</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">报文状态</label>

            <div class="col-md-2">
                <select class="form-control" ng-model="searchState" ng-init="searchState=''">
                    <option value="">--</option>
                    <option value='F'>发送失败</option>
                    <option value='S'>发送成功</option>
                    <option value='W'>发送告警</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">发送方</label>

            <div class="col-md-2">
                <select class="form-control" ng-model="searchSend" ng-init="searchSend='-1'">
                    <option value="-1">--</option>
                    <option ng-repeat="x in trafficUsers" value="{{x.id}}">{{x.userName}}</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">接收方</label>

            <div class="col-md-2">
                <select class="form-control" ng-model="searchReceive" ng-init="searchReceive='-1'">
                    <option value="-1">--</option>
                    <option ng-repeat="x in trafficUsers" value="{{x.id}}">{{x.userName}}</option>
                </select>
            </div>
        </div>
        <div class="row">
        </div>
        <div>
            <div class="form-group">
                <div class="col-md-3">
                    <input type="text" class="form-control " id="content" ng-model="searchRawMsg" placeholder="报文关键字">
                </div>
            </div>
            <div class="form-group" data-provide="datepicker">
                <label class="col-md-1 control-label">开始时间</label>

                <div class="col-md-2">
                    <input id="dateStart"type="datetime" style="width: 100%" class="datetimepicker" data-provide="datetimepicker-inline"  ng-model="searchDateStart"  readonly>
                </div>
            </div>
            <div class="form-group" data-provide="datepicker">
                <label class="col-md-1 control-label">结束时间</label>

                <div class="col-md-2">
                    <input id="dateEnd"type="datetime" style="width: 100%"  class="datetimepicker" data-provide="datetimepicker-inline"  ng-model="searchDateEnd"  readonly>
                </div>
            </div>
            <div class="col-md-3">
                <button type="submit" ng-click="findByConditions()" class="btn btn-primary">查询</button>
                <button type="button" class="btn btn-success" ng-click="export()">导出</button>
            </div>
        </div>
        <div class="row">
        </div>

    </form>
    <div style="overflow:auto">
        <table class="table table-bordered table-striped  table-condensed table-hover" style="table-layout:fixed">
            <thead>
            <tr>
                <th style="width: 5%">ID</th>
                <th style="width: 8%">报文类型</th>
                <th style="width: 10%">发送时间</th>
                <th style="width: 12%">发送用户</th>
                <th style="width: 20%">接收用户</th>
                <th style="width: 37%">报文原文</th>
                <th style="width: 8%">报文发送状态</th>
            </tr>
            </thead>
            <tr ng-repeat="x in traffics">
                <td style="vertical-align: middle">{{ $index + 1 }}</td>
                <td style="vertical-align: middle">{{x.msgType }}</td>
                <td style="vertical-align: middle">{{x.dateTime }}</td>
                <td style="vertical-align: middle">{{x.senderName }}</td>
                <td style="vertical-align: middle">{{x.receiverName }}</td>
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align: middle"
                    data-toggle="tooltip" data-placement="top" title="{{x.rawMsg}}">{{x.rawMsg}}
                </td>
                <td style="vertical-align: middle" ng-if="x.state=='S'">发送成功</td>
                <td style="vertical-align: middle" ng-if="x.state=='W'">发送告警</td>
                <td style="vertical-align: middle" ng-if="x.state=='F'">发送失败</td>
            </tr>
        </table>
    </div>
    <nav style="margin-top: 20px" class="form-inline">
        <ul class="pagination">
            <li id="top" class="input-group">
                <a ng-click="firstPage()">
                    <span>首页</span>
                </a>
            </li>
            <li id="previous" class="input-group">
                <a ng-click="previous()">
                    <span>上一页</span>
                </a>
            </li>
            <li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}" class="input-group">
                <a ng-click="selectCurrentPage(page)" class="form-control">{{ page }}</a>
            </li>
            <li id="next" class="input-group">
                <a ng-click="next()">
                    <span>下一页</span>
                </a>
            </li>
            <li id="bottom" class="input-group">
                <a ng-click="lastPage()">
                    <span>尾页</span>
                </a>
            </li>
            <li class="input-group">
                <%--可设置默认条数--%>
                <select ng-model="selectPageSize" class="form-control" ng-init="selectPageSize='25'"
                        ng-change="changePageSize(selectPageSize)">
                    <option value="25">25</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                </select>
            </li>
        </ul>
    </nav>
</div>
</body>
</html>
